package com.ruoyi.web.controller.common;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.service.ReadFileInterface;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/file")
public class ReadFileController {

    private final ReadFileInterface fileInterface;

    public ReadFileController(ReadFileInterface fileInterface) {
        this.fileInterface = fileInterface;
    }

    @GetMapping("/listenWordList")
    public AjaxResult getWordDataFromFile(@RequestParam String wordFileNum){
        List<String> list = fileInterface.getWordDataFromFile(wordFileNum);
        return AjaxResult.success(list);
    }
}
